home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / GSXSAM.ZIP;1 / WINMOVE.PRG < prev   
Encoding:
Text File  |  1993-08-06  |  3.2 KB  |  98 lines

  1. ***************************************************************************
  2. *
  3. * Procedure file: WINMOVE.PRG
  4. *         System: GenScrnX
  5. *        Version: 1.4
  6. *         Author: Ken R. Levy
  7. *        Company: Jet Propulsion Laboratory
  8. *      Copyright: None (Public Domain)
  9. *
  10. ***************************************************************************
  11. *
  12. * WINMOVE - Window Move driver.
  13. *
  14. * Description:
  15. * This program is used as an optional driver for use with GENSCRNX.PRG.
  16. *
  17. * Features:
  18. * Moves screen window off screen of display while Screen Layout is executed.
  19. * This prevents the visual delay of GET/SAY refresh becuase the window
  20. * is moved by row/column 800,800 during the Screen Layout and back to the
  21. * original position at the end of the READ Show routine.
  22. *
  23. * Notes:
  24. * In this program, for clarity/readability reasons, variable names
  25. * are used that are longer than 10 characters.  Note, however, that only
  26. * the first 10 characters are significant.
  27. *
  28. * Important:
  29. * Function calls made from this program may be contained in GENSCRNX.PRG.
  30. * Variable names not declared PRIVATE in this program defined PRIVATE in
  31. * GENSCRNX.PRG.
  32. *
  33. PRIVATE m.winname,m.codedata
  34.  
  35. * Ignore for non-header record or driver disable mode.
  36. IF OBJTYPE#1.OR..NOT.drvenable(PROGRAM())
  37.   GOTO BOTTOM
  38.   RETURN .F.
  39. ENDIF
  40.  
  41. * Verify that the a window name has been defined in the Screen Layout.
  42. IF EMPTY(NAME)
  43.   =warning("Driver '"+PROGRAM()+"' requires ["+ALLTRIM(m.platform_)+;
  44.            "] screen name to be defined")
  45.   GOTO BOTTOM
  46.   RETURN .F.
  47. ENDIF
  48.  
  49. * Get window name through GENSCRNX's evltxt() routine to process any braces
  50. * that may exist.
  51. m.winname=evltxt(m.name)
  52.  
  53. * Create line of code to move window off screen.
  54. m.codedata="IF WLROW('"+m.winname+"')<800"+m.cr_lf+;
  55.            "  MOVE WINDOW "+m.winname+" BY 800,800"+m.cr_lf+"ENDIF"
  56.  
  57. * Append code to Setup snippet if it doesn't already exist.  Note m.cr_lf
  58. * is a private variable defined in GENSCRNX equal to CHR(13)+CHR(10).
  59. IF .NOT.m.codedata$SETUPCODE
  60.   REPLACE SETUPCODE WITH SETUPCODE+m.cr_lf+m.codedata
  61. ENDIF
  62.  
  63. * Create line of code to move window back on screen.
  64. m.codedata="IF WLROW('"+m.winname+"')>=800"+m.cr_lf+;
  65.            "  MOVE WINDOW "+m.winname+" BY -800,-800"+m.cr_lf+"ENDIF"
  66.  
  67. * If the READ Show routine is defined as an expression and is empty, convert
  68. * it to a procedure.
  69. IF SHOWTYPE#1.AND.EMPTY(SHOW)
  70.   REPLACE SHOWTYPE WITH 1
  71. ENDIF
  72.  
  73. * If the READ Show routine is defined as a procedure, append code.
  74. * Else if READ Show routine is defined as an expression, add code to
  75. * end of the Screen Layout routine by adding an *:INSTXT object at the
  76. * end of the .SCX database.  Use the insrec() function to insert the record
  77. * and use the instxt() function to add the *:INSTXT + code the object.
  78. * As noted above, all functions called are contained in GENSCRNX.
  79. IF SHOWTYPE=1
  80.   IF .NOT.m.codedata$SHOW
  81.     REPLACE SHOW WITH SHOW+m.cr_lf+m.codedata
  82.   ENDIF
  83. ELSE
  84.   LOCATE FOR m.codedata$SETUPCODE
  85.   IF EOF()
  86.     GOTO BOTTOM
  87.     IF insrec()
  88.       =instxt1(m.codedata)
  89.     ENDIF
  90.   ENDIF
  91. ENDIF
  92.  
  93. * Go to bottom of .SCX database to have GENSCRNX skip calling this driver
  94. * for every non-header record.
  95. GOTO BOTTOM
  96.  
  97. RETURN .T.
  98.